<template>
	<view>
		<view class="">
			<view class="u-demo-block" style="margin-bottom: 20rpx;margin-top: 20rpx;">
				<view class="u-demo-block__content">
					<u-row customStyle="margin-bottom: 10px">
						<u-col span="3" style="">
							<view style="width:160rpx; height: 160rpx; border-radius: 50%; " >
								<image :src="arr.photoimg" mode="" style="width: 80px; height: 160rpx; border-radius: 50%;"></image>
							</view>
						</u-col>
						<u-col span="6">
							<view style="font-size: 16px;text-align: left; margin-left: 20rpx;" >
                                     <h3> {{arr.userName}}   </h3>   
							</view>
							<view style="font-size: 16px; margin-left: 20rpx;">
											{{arr.phone}}
							</view>
						</u-col>
						<u-col span="3">
							<view>
								<u-icon name="setting" size="30" @click="userinfo(arr.userId)" style="float: right;"></u-icon>
								<u-icon name="bell" size="30"  @click="liaot()" style="margin-right: 20rpx ;float: right;"></u-icon>

							</view>
						</u-col>
					</u-row>
					<u-row customStyle="">
						<u-col span="9">
							<view style="font-size: 16px;margin-left: 20rpx;">
								<p style="height: 40px;padding-top: 20px;">总资产（币）</p>
							</view>
						</u-col>
					</u-row>
					<u-row justify="space-between" style="margin-left: 60rpx; margin-bottom: 30rpx;">
						<u-col span="9">
							{{arr.balance}}
							<!-- <view style="margin-left: 20rpx;font-size: 22px;">{{account.gllob}}</view> -->
						</u-col>
					</u-row>
				</view>
			</view>
		</view>
		<view class="">
			回收订单
			<u-grid :border="false" col="4">
				<u-grid-item v-for="(listItem,listIndex) in list" :key="listIndex">
					<navigator :url="listItem.url" hover-class="navigator-hover">
						<u-icon :customStyle="{paddingTop:20+'rpx'}" style="margin-left: 18rpx;" :name="listItem.name"
							:size="22"></u-icon>
						<text class="grid-text">{{listItem.title}}</text>
					</navigator>
				</u-grid-item>
			</u-grid>
			<u-toast ref="uToast" />
		</view>

		<view class="">
			兑换订单
			<u-grid :border="false" col="4">
				<u-grid-item v-for="(listItem2,listIndex2) in list2" :key="listIndex">
					<navigator :url="listItem2.url" hover-class="navigator-hover">
						<u-icon :customStyle="{paddingTop:20+'rpx'}" style="margin-left: 18rpx;" :name="listItem2.name"
							:size="22"></u-icon>
						<text class="grid-text">{{listItem2.title}}</text>
					</navigator>
				</u-grid-item>
			</u-grid>
			<u-toast ref="uToast" />
		</view>


		<view class="">
			常用功能
			<u-grid :border="false" col="4">
				<u-grid-item v-for="(listItem3,listIndex3) in list3" :key="listIndex">
						<navigator :url="listItem3.url" hover-class="navigator-hover">
					<u-icon :customStyle="{paddingTop:20+'rpx'}" style="margin-left: 10rpx;" :name="listItem3.name" :size="22"></u-icon>
					<text class="grid-text">{{listItem3.title}}</text>
					</navigator>
				</u-grid-item>
			</u-grid>
			<u-toast ref="uToast" />
		</view>
		<!--  <button type="default"@click="ss()">sss </button> -->
		<!-- 
		<image src="../../static/img/dingdn.png" mode=""></image> -->
	</view>

</template>

<script>
	import request from '../../request.js'
	export default {
		data() {
			return {
				userId:'',
				arr:{},
				userIds:'',
				list: [{
						name: '../../static/img/dd.png',
						title: '待接单',
						url: '../zc/users?curNow=0'
					},
					{
						name: '../../static/img/dd.png',
						title: '已接单',
						url: '../zc/users?curNow=1'
					},
					{
						name: '../../static/img/24gf-box2.png',
						title: '收货中',
						url: '../zc/users?curNow=2'
					},
					{
						name: '../../static/img/24gf-box2.png',
						title: '已完成',
						url: '../zc/users?curNow=3'
					},
				],


				list2: [{
						name: '../../static/img/shouh.png',
						title: '待支付',
						url: '../zc/commodityorder?curNow=0'
					},
					{
						name: '../../static/img/24gf-box2.png',
						title: '待取货',
						url: '../zc/commodityorder?curNow=1'
					},
					{
						name: '../../static/img/paisong.png',
						title: '配送中',
						url: '../zc/commodityorder?curNow=2'
					},
					{
						name: '../../static/img/dingdn.png',
						title: '已完成',
						url: '../zc/commodityorder?curNow=3'
					},
				],

				list3: [{
						name: '../../static/img/shouc.png',
						title: '收藏',
						url:'../zc/mycollections'
					},
					{
						name: '../../static/img/zuji.png',
						title: '足迹',
						url:'../zc/footprint'
					},

				],
			}
		},
		onLoad() {
		this.load()		
		},
		methods: {
			load(){
				uni.getStorage({
									key: 'userid',
									success: res => {
										this.userid = res.data
										console.log("zaizhe", this.userid)
										this.userId=this.userid	
											console.log(this.userId)
									}
								})
				console.log(this.userId)
				request({
					url:"xkuser/user/load/"+this.userId,
					method:'get',
					success:(res)=>{
						this.arr=res.data.data.arr
						console.log(this.arr)
					}
				})
			},
			liaot() {
							uni.navigateTo({
								url:'/pages/message/chat?conversationID=C2C' + 3
							})
						},
			userinfo(arr){
				this.userIds = arr
				// console.log(this.userIds)
				uni.navigateTo({
					url:'./userinfo?userId='+this.userIds,
				})
			},
			ss() {
				uni.navigateTo({
					url: './users'
				})
			}
		}
	}
</script>

<style lang="scss">
	.grid-text {
		font-size: 14px;
		color: #909399;
		padding: 10rpx 0 20rpx 0rpx;
		/* #ifndef APP-PLUS */
		box-sizing: border-box;
		/* #endif */
	}
</style>
